package com.gan.simple_init.quartz.job;


import com.gan.simple_init.common.constant.DateFormatConstant;
import com.gan.simple_init.util.DateUtil;
import org.quartz.*;
import org.springframework.stereotype.Component;

import java.util.Date;

@DisallowConcurrentExecution// 作业不并发
@Component
public class HelloWorldJob implements Job{

    @Override
    public void execute(JobExecutionContext arg0) throws JobExecutionException {
        JobDataMap dataMap = arg0.getJobDetail().getJobDataMap();
        Long jobId = dataMap.getLongValue("jobId");
        System.out.println("jobId:" + jobId + " 正在执行任务 "+ DateUtil.parseDateToStr(DateFormatConstant.YYYY_MM_DD_HH_MM_SS,new Date()));

    }

}
